//
// Created by HP on 2025/12/1.
//

#ifndef FLIGHTSERVER_ADMINLOG_H
#define FLIGHTSERVER_ADMINLOG_H
#include "Model.h"

// 管理操作日志模型
class AdminLog : public Model{
public:
    std::string id;
    std::string operatorId;
    std::string operatorName; //操作者姓名
    std::string action; // 操作
    std::string targetObject; // 操作目标
    std::string details;
    std::string ipAddress;
    std::string success;
    std::string createdAt;

    AdminLog();
    
    void bind(const std::string& key, const std::string& value);
    
    bool save();
    
    // Getter methods
    std::string getId() const { return id; }
    std::string getOperatorId() const { return operatorId; }
    std::string getOperatorName() const { return operatorName; }
    std::string getAction() const { return action; }
    std::string getTargetObject() const { return targetObject; }
    std::string getDetails() const { return details; }
    std::string getIpAddress() const { return ipAddress; }
    std::string getSuccess() const { return success; }
    std::string getCreatedAt() const { return createdAt; }
    
    // Setter methods
    void setId(const std::string& newId) { id = newId; }
    void setOperatorId(const std::string& newOperatorId) { operatorId = newOperatorId; }
    void setOperatorName(const std::string& newOperatorName) { operatorName = newOperatorName; }
    void setAction(const std::string& newAction) { action = newAction; }
    void setTargetObject(const std::string& newTargetObject) { targetObject = newTargetObject; }
    void setDetails(const std::string& newDetails) { details = newDetails; }
    void setIpAddress(const std::string& newIpAddress) { ipAddress = newIpAddress; }
    void setSuccess(const std::string& newSuccess) { success = newSuccess; }
};


#endif //FLIGHTSERVER_ADMINLOG_H
